package joe.beer;

public class Beer {

	String brewery = "";
	String beerName = "";
	String beerCal = "";
	String beerABV = "";
	String beerCarb = "";
	String _orig = "";

	public Beer (String parseMe)
	{
		_orig = parseMe;
		String delims = ",";
		String[] tokens = parseMe.split(delims);
		for (int i = 0; i < tokens.length; i++)
		{
			switch(i)
			{
			case 0: brewery = tokens[i]; break;
			case 1: beerName = tokens[i]; break;
			case 2: beerABV = tokens[i]; break;
			case 3: beerCal = tokens[i]; break;
			case 4: beerCarb = tokens[i]; break;
			}
		}
	}

	public String getBrewery()
	{
		return brewery;
	}

	public String getName()
	{
		return brewery + " - " + beerName + " (" + beerABV + "%)";
	}
	public String getABV()
	{
		return beerABV;
	}

	@Override
	public String toString() {
		return brewery + " - " + beerName;
	}

	public String returnCSV()
	{
		return _orig;
	}
	public String getCal()
	{
		return beerCal;
	}
	public String getCarb()
	{
		return beerCarb;
	}
}
